home *** CD-ROM | disk | FTP | other *** search
- Path: INbe.net!usenet
- From: De Ceunynck <pub01228@innet.be>
- Newsgroups: comp.lang.c
- Subject: Writing to keyboard buffer
- Date: 13 Mar 1996 21:47:29 GMT
- Organization: INnet NV (post doesn't reflect views of INnet NV)
- Message-ID: <4i7fpi$sfv@news.be.innet.net>
- NNTP-Posting-Host: pool03-79.innet.be
- Mime-Version: 1.0
- Content-Type: multipart/mixed;
- boundary="-------------------------------242181555424622"
- X-Mailer: Mozilla 1.1 (Windows; I; 16bit)
-
- This is a multi-part message in MIME format.
-
- ---------------------------------242181555424622
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
-
- Hello, I've got a little problem simulating extended keystrokes.
-
- The problem is :
- To overcome a problem with the Matrox video board in Windows 3.11 I need
- to start a DOS box as a window and then expand it to full screen with
- alt-enter. To do this automatically I intended to write a small C
- program that writes the two-byte scan-code (0 ; 1e) directly in the
- keyboard buffer as if it was typed.
- For some reason it is not possible to write a zero in the buffer. I can
- write and read any other value in the buffer but it won't accept a zero.
-
- Does anyone know a solution for this?
-
- Kind regards
- Herman Currinckx
-
- ---------------------------------242181555424622
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain
-
- #include <stdio.h>
- #include <conio.h>
- #include <dos.h>
-
- void main(void)
- { union REGS regs;
- int c;
-
- clrscr();
- flushall();
- regs.h.ah=5;
- regs.h.cl=0x1c;
- regs.h.ch=0;
- int86(0x16,®s,®s);
- regs.h.ah=5;
- regs.h.cl=28;
- regs.h.ch=0;
- int86(0x16,®s,®s);
- c = getch();
- printf("%d",c);
- c = getch();
- printf(" %d\n",c);
- getch();
- }
- ---------------------------------242181555424622--
-